/**
Date: 2025-08-13
Copyright (c) 2025 Industrial Software Feature Database
*/
import request from '@/utils/request';

// 条件查询数据源数据模板列表
export function getTemplateByCondition(data){
  return request({
    url: `/isfd/datasourceTemplate/queryTemplateByCondition`,
    method: 'post',
    data
  });
} 

// 数据源数据模板详情
export function getDataSourceDetail(id){
  return request({
    url: `/isfd/datasourceTemplate/${id}`,
    method: 'get',
  });
}
// 获取数据同步任务列表
export function getTaskMonitoringList(data) {
  return request({
    url: `/isfd/datasourceTaskInstanceLog/execute/list`,
    method: 'post',
    data
  });
}

// 中止接口
export function suspendTask(data) {
  return request({
    url: `/isfd/datasourceTaskSchedulingConfig/suspend`,
    method: 'post',
    data
  });
}

// 实时&离线任务列表
export function getDatasourceDataIntegrationTaskList(params){
  return request({
    url: `/isfd/datasourceDataIntegrationTask/list`,
    method: 'get',
    params
  });
}

// 新增实时&离线任务
export function addDatasourceDataIntegrationTask(data){
  return request({
    url: `/isfd/datasourceDataIntegrationTask`,
    method: 'post',
    data
  })
};

// 删除实时&离线任务
export function deleteDatasourceDataIntegrationTask(id){
  return request({
    url: `/isfd/datasourceDataIntegrationTask/${id}`,
    method: 'delete',
  })  
};

// 编辑实时&离线任务
export function editDatasourceDataIntegrationTask(data){
  return request({
    url: `/isfd/datasourceDataIntegrationTask`,
    method: 'put',
    data
  })
};

// 实时&离线任务详情
export function getDatasourceDataIntegrationTaskDetail(id){
  return request({
    url: `/isfd/datasourceDataIntegrationTask/${id}`,
    method: 'get',
  })
}

// 任务触发
export function triggerDatasourceDataIntegrationTask(data){
  return request({
    url: `/isfd/datasourceTaskSchedulingConfig/trigger`,
    method: 'post',
    data
  })
}
// 获取数据同步任务列表
export function getLogList(data) {
  return request({
    url: `/isfd/datasourceTaskInstanceLog/list`,
    method: 'post',
    data
  });
}

// 通过库名表名查询表结构
export function getTableStructure(data) {
  return request({
    url: `/isfd/datasourceDataIntegrationTask/datasource/table`,
    method: 'post',
    data
  }); 
}